package Demo01;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 28463
 * Date: 2022—06—22
 * Time: 16:33
 */
public class Test04 {
    public static void main(String[] args) {
        int a = 30;
        Integer integer  = a;

        int val = integer;//自动拆箱
        System.out.println(val);

        int val2 = integer.intValue();//显示拆箱
        System.out.println(val2);

        double val3 = integer.doubleValue();//显示拆箱
        System.out.println(val3);
    }
    public static void main1(String[] args) {
        int a = 20;
        Integer integer = a;//自动装箱
        System.out.println(a);
/*        Integer integer2 = new Integer(a);//显示装箱

        Integer integer3 = Integer.valueOf(a);//显示装箱

        System.out.println(integer);
        System.out.println(integer2);
        System.out.println(integer3);*/
    }
}
